#include <iostream>
#include "ShareMemory.hpp"
#include <string.h>
#include "time.hpp"
#include "fifo.hpp"

int main()
{
    shm.GetShm();
    shm.AttachShm();


    gpipe.OpenPipeForWrite();
    // addr --- > 写入数据 
    std::cout << shm.Getaddr() << " " << shm.Getshmid() <<" " << shm.Getkey() << " " <<std::endl;
    struct data *image = (struct data*)shm.Getaddr();
    char ch = 'A';
    while(ch <= 'Z')
    {
        strcpy(image->status,"最新");
        strcpy(image->lasttime,GetCurTime().c_str());
        strcpy(image->image,"xxaasdawdadada");
        gpipe.Signal();
        sleep(3);
    }
    shm.DetachShm();
    shm.DeleteShm();
    return 0;
}